<?php
/**
 * 公共包含文件
 * 
 * Created	: 2010-10-11
 * Modified : 2010-10-11
 * @author  : 陈立强
 */
$start_time = microtime(true);
//session_start();
error_reporting(E_ALL & ~E_STRICT);

$debug = 1;// 是否调试版本

$root = dirname(dirname(__FILE__)).'/';
$G['path_inc']     = $root.'inc/';
$G['path_cfg']     = $root.'inc/conf/';
$G['path_class']   = $root.'inc/class/';
$G['path_lang']    = $root.'inc/lang/';
$G['path_data']    = $root.'data/';
$G['path_webroot'] = $root.'webroot/';

$G['url_img'] = '/';

$amfphp = array(
	'root' => $root.'amfphp/'
);
$L = array();// 语言变量
$C = array();// 配置变量


$amfphp['startTime'] = $start_time;

$servicesPath = $amfphp['root'].'services/';
$voPath       = $amfphp['root'].'vo/';

include $G['path_cfg'].'common.cfg.php';
include $G['path_inc'].'functions.php';
$L = array(); //保存所有的语言包内容

L('common', 'user');

require $G['path_class'].'MCBase.class.php';

header('content-type:text/html;charset=utf-8');

isset($_SESSION['uid']) or $_SESSION['uid'] = 0;

$start = microtime(1);
$DB = new DB(
	array(
		'host'     => $G['db_host'],
		'dbName'   => $G['db_name'],
		'userName' => $G['db_user'],
		'passWord' => $G['db_pass'],
		'provider' => $G['db_provider'],
		'charset'  => $G['db_charset']
	)
);
$m = new Memcache;
$m->connect($G['memcache_host'], $G['memcache_port']);

include $G['path_class'].'Session.class.php';

// 初始化游戏数据
Game::start();

// 服务返回的结果
$results = array(
	'val' => true,
	'server_time' => $_SERVER['REQUEST_TIME']
);



//不能被请求的方法
$ignoreMethod = array(
	'init', 'initialize',
	'SGame::start', 'SGame::updateGameDate',
	'SBag::in', 'SBag::out',
	'SDepot::in', 'SDepot::out', 'SDepot::getFreeCapacity',
	'SFarm::mature',
	'SFruitForest::endGrowUp','SFruitForest::mature','SFruitForest::addVigorous',
	'SGather::update', 'SGather::endWork', 'SGather::getLvl',
	'SRaise::update', 'SRaise::endGrowUp', 'SRaise::endSc', 'SRaise::calcFoodVal',
	'SSkill::addExp', 'SSkill::isStudied',
	'SMaking::addRecipeExp', 'SMaking::getRecipeTotalPopVal', 'SMaking::calcPkResult',
	'Market::handleEndSale',
	'SShop::create', 'SShop::addExp', 'SShop::addProficiency', 
	'SShop::addQueueGuest', 'SShop::getDepotFreeSpace',
	'SShop::endBuy', 'SShop::depotIn',
	'SStaff::add', 'SStaff::addExp', 'SStaff::addPotentialExp', 'SStaff::addTrainPoint', 
	'SStaff::randName',
	'SUser::changeValue', 'SUser::addExp', 'SUser::addProficiency', 'SUser::initUserProficiency', 'SUser::create',/* 'SUser::login',*/
	'SUser::refresh',
	'SFriend::getFriendlyVal',
	'SMessage::getAttachment',
	'SPropsBox::in',
);
